//package cn.ctodb.im.server.filter;
//
//import cn.ctodb.im.api.Command;
//import cn.ctodb.im.api.Connection;
//import cn.ctodb.im.api.Filter;
//import cn.ctodb.im.api.FilterResult;
//import cn.ctodb.im.server.peer.Peer;
//import cn.ctodb.im.server.peer.PeerManager;
//import com.google.protobuf.MessageLite;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.util.HashSet;
//import java.util.Set;
//
///**
// * All rights Reserved, Designed By www.ctodb.cn
// *
// * @version V1.0
// * @author: lichaohn@163.com
// * @Copyright: 2018 www.ctodb.cn Inc. All rights reserved.
// */
//public class AuthFilter implements Filter {
//
//    private Logger logger = LoggerFactory.getLogger(AuthFilter.class);
//
//    public Set<Command> commands = new HashSet<>();
//
//    public void addCmd(Command command) {
//        commands.add(command);
//    }
//
//    @Override
//    public FilterResult exec(Command cmd, MessageLite packet, Connection connection) {
//        if (commands.contains(cmd)) {
//            Peer peer = PeerManager.get(connection.getChc().channel());
//            if (peer == null) return FilterResult.END;
//        }
//        return null;
//    }
//}
